package pl.bristleback.server.bristle.binding;

import pl.bristleback.server.bristle.actions.RemoteAction;
import pl.bristleback.server.bristle.config.BristleConfiguration;
import pl.bristleback.server.bristle.utils.ActionClassElement;

import java.util.List;

/**
 * Implementations of this interface are responsible for processing binding annotations in every action classes.
 * Every action class can contain multiple object binders, list of binder instances is returned for every action class.
 * Binding processors are obligated to search binding annotations.
 * <p/>
 * Created on: 2011-03-27 13:16:51 <br/>
 *
 * @author Wojciech Niemiec
 */
public interface BindingsProcessor {

  /**
   * Processes {@link pl.bristleback.server.bristle.binding.Bind} and nested {@link pl.bristleback.server.bristle.binding.Property} annotations
   * in given action classes, stores information about bindings in object binders.
   * Root element and every property elements should be wrapped into {@link NestedFieldInformation} objects.
   *
   * @param actionClass   action class to process.
   * @param configuration Bristleback plugin configuration, containing information about default binding engine.
   * @return list of action class elements, object binders.
   * @see pl.bristleback.server.bristle.binding.NestedFieldInformation Creating root and adding children.
   */
  List<ActionClassElement<ObjectBinder>> processBindings(Class<? extends RemoteAction> actionClass, BristleConfiguration configuration);
}
